﻿using MetroNextTools.NData;
using System;
using System.Collections.Specialized;

namespace MetroNextTools.NEventArgs
{
    public class NItemsChangedEventArgs : EventArgs
    {
        private NotifyCollectionChangedAction _action;      //元素行为
        private NGeneratorPosition _position;                //新位置
        private NGeneratorPosition _oldPosition;             //旧位置
        private int _itemCount;                             //数据数目
        private int _itemUICount;                           //UI数据数目

        public NItemsChangedEventArgs(NotifyCollectionChangedAction action, NGeneratorPosition position, NGeneratorPosition oldPosition, int itemCount, int itemUICount)
        {
            this._action = action;
            this._position = position;
            this._oldPosition = oldPosition;
            this._itemCount = itemCount;
            this._itemUICount = itemUICount;
        }

        public NItemsChangedEventArgs(NotifyCollectionChangedAction action, NGeneratorPosition position, int itemCount, int itemUICount)
            : this(action, position, new NGeneratorPosition(-1), itemCount, itemUICount)
        {
        }

        public NotifyCollectionChangedAction Action
        {
            get { return _action; }
        }

        public NGeneratorPosition Position
        {
            get { return _position; }
        }

        public NGeneratorPosition OldPosition
        {
            get { return _oldPosition; }
        }

        public int ItemCount
        {
            get { return _itemCount; }
        }

        public int ItemUICount
        {
            get { return _itemUICount; }
        }
    }
}
